Optimal. Leaf size=236 \[ \frac {2 a^2 \cos (c+d x)}{d^3}+\frac {2 a^2 x \sin (c+d x)}{d^2}-\frac {a^2 x^2 \cos (c+d x)}{d}-\frac {48 a b \cos (c+d x)}{d^5}-\frac {48 a b x \sin (c+d x)}{d^4}+\frac {24 a b x^2 \cos (c+d x)}{d^3}+\frac {8 a b x^3 \sin (c+d x)}{d^2}-\frac {2 a b x^4 \cos (c+d x)}{d}+\frac {720 b^2 \cos (c+d x)}{d^7}+\frac {720 b^2 x \sin (c+d x)}{d^6}-\frac {360 b^2 x^2 \cos (c+d x)}{d^5}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}-\frac {b^2 x^6 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.33, antiderivative size = 236, normalized size of antiderivative = 1.00, number of steps used = 17, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3339, 3296, 2638} \[ \frac {2 a^2 x \sin (c+d x)}{d^2}+\frac {2 a^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {48 a b x \sin (c+d x)}{d^4}-\frac {48 a b \cos (c+d x)}{d^5}-\frac {2 a b x^4 \cos (c+d x)}{d}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {360 b^2 x^2 \cos (c+d x)}{d^5}+\frac {720 b^2 x \sin (c+d x)}{d^6}+\frac {720 b^2 \cos (c+d x)}{d^7}-\frac {b^2 x^6 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 3296
Rule 3339
Rubi steps
\begin {align*} \int x^2 \left (a+b x^2\right )^2 \sin (c+d x) \, dx &=\int \left (a^2 x^2 \sin (c+d x)+2 a b x^4 \sin (c+d x)+b^2 x^6 \sin (c+d x)\right ) \, dx\\ &=a^2 \int x^2 \sin (c+d x) \, dx+(2 a b) \int x^4 \sin (c+d x) \, dx+b^2 \int x^6 \sin (c+d x) \, dx\\ &=-\frac {a^2 x^2 \cos (c+d x)}{d}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}+\frac {\left (2 a^2\right ) \int x \cos (c+d x) \, dx}{d}+\frac {(8 a b) \int x^3 \cos (c+d x) \, dx}{d}+\frac {\left (6 b^2\right ) \int x^5 \cos (c+d x) \, dx}{d}\\ &=-\frac {a^2 x^2 \cos (c+d x)}{d}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}+\frac {2 a^2 x \sin (c+d x)}{d^2}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}-\frac {\left (2 a^2\right ) \int \sin (c+d x) \, dx}{d^2}-\frac {(24 a b) \int x^2 \sin (c+d x) \, dx}{d^2}-\frac {\left (30 b^2\right ) \int x^4 \sin (c+d x) \, dx}{d^2}\\ &=\frac {2 a^2 \cos (c+d x)}{d^3}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}+\frac {2 a^2 x \sin (c+d x)}{d^2}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}-\frac {(48 a b) \int x \cos (c+d x) \, dx}{d^3}-\frac {\left (120 b^2\right ) \int x^3 \cos (c+d x) \, dx}{d^3}\\ &=\frac {2 a^2 \cos (c+d x)}{d^3}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}-\frac {48 a b x \sin (c+d x)}{d^4}+\frac {2 a^2 x \sin (c+d x)}{d^2}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}+\frac {(48 a b) \int \sin (c+d x) \, dx}{d^4}+\frac {\left (360 b^2\right ) \int x^2 \sin (c+d x) \, dx}{d^4}\\ &=-\frac {48 a b \cos (c+d x)}{d^5}+\frac {2 a^2 \cos (c+d x)}{d^3}-\frac {360 b^2 x^2 \cos (c+d x)}{d^5}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}-\frac {48 a b x \sin (c+d x)}{d^4}+\frac {2 a^2 x \sin (c+d x)}{d^2}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}+\frac {\left (720 b^2\right ) \int x \cos (c+d x) \, dx}{d^5}\\ &=-\frac {48 a b \cos (c+d x)}{d^5}+\frac {2 a^2 \cos (c+d x)}{d^3}-\frac {360 b^2 x^2 \cos (c+d x)}{d^5}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}+\frac {720 b^2 x \sin (c+d x)}{d^6}-\frac {48 a b x \sin (c+d x)}{d^4}+\frac {2 a^2 x \sin (c+d x)}{d^2}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}-\frac {\left (720 b^2\right ) \int \sin (c+d x) \, dx}{d^6}\\ &=\frac {720 b^2 \cos (c+d x)}{d^7}-\frac {48 a b \cos (c+d x)}{d^5}+\frac {2 a^2 \cos (c+d x)}{d^3}-\frac {360 b^2 x^2 \cos (c+d x)}{d^5}+\frac {24 a b x^2 \cos (c+d x)}{d^3}-\frac {a^2 x^2 \cos (c+d x)}{d}+\frac {30 b^2 x^4 \cos (c+d x)}{d^3}-\frac {2 a b x^4 \cos (c+d x)}{d}-\frac {b^2 x^6 \cos (c+d x)}{d}+\frac {720 b^2 x \sin (c+d x)}{d^6}-\frac {48 a b x \sin (c+d x)}{d^4}+\frac {2 a^2 x \sin (c+d x)}{d^2}-\frac {120 b^2 x^3 \sin (c+d x)}{d^4}+\frac {8 a b x^3 \sin (c+d x)}{d^2}+\frac {6 b^2 x^5 \sin (c+d x)}{d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.42, size = 139, normalized size = 0.59 \[ \frac {2 d x \left (a^2 d^4+4 a b d^2 \left (d^2 x^2-6\right )+3 b^2 \left (d^4 x^4-20 d^2 x^2+120\right )\right ) \sin (c+d x)-\left (a^2 d^4 \left (d^2 x^2-2\right )+2 a b d^2 \left (d^4 x^4-12 d^2 x^2+24\right )+b^2 \left (d^6 x^6-30 d^4 x^4+360 d^2 x^2-720\right )\right ) \cos (c+d x)}{d^7} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 154, normalized size = 0.65 \[ -\frac {{\left (b^{2} d^{6} x^{6} - 2 \, a^{2} d^{4} + 2 \, {\left (a b d^{6} - 15 \, b^{2} d^{4}\right )} x^{4} + 48 \, a b d^{2} + {\left (a^{2} d^{6} - 24 \, a b d^{4} + 360 \, b^{2} d^{2}\right )} x^{2} - 720 \, b^{2}\right )} \cos \left (d x + c\right ) - 2 \, {\left (3 \, b^{2} d^{5} x^{5} + 4 \, {\left (a b d^{5} - 15 \, b^{2} d^{3}\right )} x^{3} + {\left (a^{2} d^{5} - 24 \, a b d^{3} + 360 \, b^{2} d\right )} x\right )} \sin \left (d x + c\right )}{d^{7}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.56, size = 162, normalized size = 0.69 \[ -\frac {{\left (b^{2} d^{6} x^{6} + 2 \, a b d^{6} x^{4} + a^{2} d^{6} x^{2} - 30 \, b^{2} d^{4} x^{4} - 24 \, a b d^{4} x^{2} - 2 \, a^{2} d^{4} + 360 \, b^{2} d^{2} x^{2} + 48 \, a b d^{2} - 720 \, b^{2}\right )} \cos \left (d x + c\right )}{d^{7}} + \frac {2 \, {\left (3 \, b^{2} d^{5} x^{5} + 4 \, a b d^{5} x^{3} + a^{2} d^{5} x - 60 \, b^{2} d^{3} x^{3} - 24 \, a b d^{3} x + 360 \, b^{2} d x\right )} \sin \left (d x + c\right )}{d^{7}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.02, size = 746, normalized size = 3.16 \[ \frac {\frac {b^{2} \left (-\left (d x +c \right )^{6} \cos \left (d x +c \right )+6 \left (d x +c \right )^{5} \sin \left (d x +c \right )+30 \left (d x +c \right )^{4} \cos \left (d x +c \right )-120 \left (d x +c \right )^{3} \sin \left (d x +c \right )-360 \left (d x +c \right )^{2} \cos \left (d x +c \right )+720 \cos \left (d x +c \right )+720 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {6 b^{2} c \left (-\left (d x +c \right )^{5} \cos \left (d x +c \right )+5 \left (d x +c \right )^{4} \sin \left (d x +c \right )+20 \left (d x +c \right )^{3} \cos \left (d x +c \right )-60 \left (d x +c \right )^{2} \sin \left (d x +c \right )+120 \sin \left (d x +c \right )-120 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{4}}+\frac {2 a b \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}+\frac {15 b^{2} c^{2} \left (-\left (d x +c \right )^{4} \cos \left (d x +c \right )+4 \left (d x +c \right )^{3} \sin \left (d x +c \right )+12 \left (d x +c \right )^{2} \cos \left (d x +c \right )-24 \cos \left (d x +c \right )-24 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-\frac {8 a b c \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}-\frac {20 b^{2} c^{3} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{4}}+a^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )+\frac {12 a b \,c^{2} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{2}}+\frac {15 b^{2} c^{4} \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}-2 a^{2} c \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )-\frac {8 a b \,c^{3} \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{2}}-\frac {6 b^{2} c^{5} \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )}{d^{4}}-a^{2} c^{2} \cos \left (d x +c \right )-\frac {2 a b \,c^{4} \cos \left (d x +c \right )}{d^{2}}-\frac {b^{2} c^{6} \cos \left (d x +c \right )}{d^{4}}}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.38, size = 612, normalized size = 2.59 \[ -\frac {a^{2} c^{2} \cos \left (d x + c\right ) + \frac {b^{2} c^{6} \cos \left (d x + c\right )}{d^{4}} + \frac {2 \, a b c^{4} \cos \left (d x + c\right )}{d^{2}} - 2 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a^{2} c - \frac {6 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b^{2} c^{5}}{d^{4}} - \frac {8 \, {\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a b c^{3}}{d^{2}} + {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} a^{2} + \frac {15 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} b^{2} c^{4}}{d^{4}} + \frac {12 \, {\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \, {\left (d x + c\right )} \sin \left (d x + c\right )\right )} a b c^{2}}{d^{2}} - \frac {20 \, {\left ({\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} b^{2} c^{3}}{d^{4}} - \frac {8 \, {\left ({\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \cos \left (d x + c\right ) - 3 \, {\left ({\left (d x + c\right )}^{2} - 2\right )} \sin \left (d x + c\right )\right )} a b c}{d^{2}} + \frac {15 \, {\left ({\left ({\left (d x + c\right )}^{4} - 12 \, {\left (d x + c\right )}^{2} + 24\right )} \cos \left (d x + c\right ) - 4 \, {\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \sin \left (d x + c\right )\right )} b^{2} c^{2}}{d^{4}} + \frac {2 \, {\left ({\left ({\left (d x + c\right )}^{4} - 12 \, {\left (d x + c\right )}^{2} + 24\right )} \cos \left (d x + c\right ) - 4 \, {\left ({\left (d x + c\right )}^{3} - 6 \, d x - 6 \, c\right )} \sin \left (d x + c\right )\right )} a b}{d^{2}} - \frac {6 \, {\left ({\left ({\left (d x + c\right )}^{5} - 20 \, {\left (d x + c\right )}^{3} + 120 \, d x + 120 \, c\right )} \cos \left (d x + c\right ) - 5 \, {\left ({\left (d x + c\right )}^{4} - 12 \, {\left (d x + c\right )}^{2} + 24\right )} \sin \left (d x + c\right )\right )} b^{2} c}{d^{4}} + \frac {{\left ({\left ({\left (d x + c\right )}^{6} - 30 \, {\left (d x + c\right )}^{4} + 360 \, {\left (d x + c\right )}^{2} - 720\right )} \cos \left (d x + c\right ) - 6 \, {\left ({\left (d x + c\right )}^{5} - 20 \, {\left (d x + c\right )}^{3} + 120 \, d x + 120 \, c\right )} \sin \left (d x + c\right )\right )} b^{2}}{d^{4}}}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.58, size = 186, normalized size = 0.79 \[ \frac {2\,\cos \left (c+d\,x\right )\,\left (a^2\,d^4-24\,a\,b\,d^2+360\,b^2\right )}{d^7}-\frac {b^2\,x^6\,\cos \left (c+d\,x\right )}{d}+\frac {6\,b^2\,x^5\,\sin \left (c+d\,x\right )}{d^2}+\frac {2\,x\,\sin \left (c+d\,x\right )\,\left (a^2\,d^4-24\,a\,b\,d^2+360\,b^2\right )}{d^6}-\frac {x^2\,\cos \left (c+d\,x\right )\,\left (a^2\,d^4-24\,a\,b\,d^2+360\,b^2\right )}{d^5}+\frac {2\,x^4\,\cos \left (c+d\,x\right )\,\left (15\,b^2-a\,b\,d^2\right )}{d^3}-\frac {8\,x^3\,\sin \left (c+d\,x\right )\,\left (15\,b^2-a\,b\,d^2\right )}{d^4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 7.53, size = 286, normalized size = 1.21 \[ \begin {cases} - \frac {a^{2} x^{2} \cos {\left (c + d x \right )}}{d} + \frac {2 a^{2} x \sin {\left (c + d x \right )}}{d^{2}} + \frac {2 a^{2} \cos {\left (c + d x \right )}}{d^{3}} - \frac {2 a b x^{4} \cos {\left (c + d x \right )}}{d} + \frac {8 a b x^{3} \sin {\left (c + d x \right )}}{d^{2}} + \frac {24 a b x^{2} \cos {\left (c + d x \right )}}{d^{3}} - \frac {48 a b x \sin {\left (c + d x \right )}}{d^{4}} - \frac {48 a b \cos {\left (c + d x \right )}}{d^{5}} - \frac {b^{2} x^{6} \cos {\left (c + d x \right )}}{d} + \frac {6 b^{2} x^{5} \sin {\left (c + d x \right )}}{d^{2}} + \frac {30 b^{2} x^{4} \cos {\left (c + d x \right )}}{d^{3}} - \frac {120 b^{2} x^{3} \sin {\left (c + d x \right )}}{d^{4}} - \frac {360 b^{2} x^{2} \cos {\left (c + d x \right )}}{d^{5}} + \frac {720 b^{2} x \sin {\left (c + d x \right )}}{d^{6}} + \frac {720 b^{2} \cos {\left (c + d x \right )}}{d^{7}} & \text {for}\: d \neq 0 \\\left (\frac {a^{2} x^{3}}{3} + \frac {2 a b x^{5}}{5} + \frac {b^{2} x^{7}}{7}\right ) \sin {\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________